from django.urls import path, re_path

from jobs import views

# urls.py
from django.urls import path

def trigger_error(request):
    division_by_zero = 1 / 0


urlpatterns = [
    # 职位列表
    path(r"joblist/", views.joblist, name="joblist"),
    # 职位详情
    re_path(r'^job/(?P<job_id>\d+)/$', views.detail, name='detail'),

    # 提交简历
    path('resume/add/', views.ResumeCreateView.as_view(), name="resume-add"),
    path('resume/<int:pk>/', views.ResumeDetailView.as_view(), name="resume-detail"),

    path('sentry-debug/', trigger_error),

    # 管理员创建 HR 账号的页面：
    path('create_hr_user/', views.create_hr_user, name="create_hr_user"),

    path("", views.joblist, name="name"),
]

from django.conf import settings

if settings.DEBUG:
    urlpatterns += [
        re_path(r'^detail_resume/(?P<resume_id>\d+)/$', views.detail_resume, name='detail_resume'),
    ]